1. Field of the Invention
The present invention relates generally to a system and method for compiling a computer program, and more particularly to a system and method for compiling a computer program wherein the computer program is adapted for use with a data parallel computer.
2. Related Art
Optimization of computer code generated by a compiler often requires that live variable analysis be performed. This analysis yields the range of program locations within which each variable is said to be live. A variable is alive at a program location if the value stored in the variable is needed later and cannot be altered.
The information produced by live variable analysis can be used in a number of ways to optimize a program. For example, if two variables have live ranges that do not overlap, then these variables may share the same storage location in the primary memory of the target computer system. As a second example, if a computer instruction stores its result in a variable which has been determined to be dead at that point, then the result of the instruction is never used later, and the instruction may be deleted from the program. This is conventionally called dead code elimination. Thus, the use of live variable information can result in both space and time improvements to a program.
Methods for conducting live variable analysis are well known. For example, a conventional method for live variable analysis is described in Compilers, Principles, Techniques, and Tools by Aho et al. However, such conventional methods are flawed for a number of reasons. For example, conventional methods for live variable analysis are not adapted for use with data parallel languages. Also, conventional methods for live variable analysis are computationally expensive at compile time.
Therefore, an efficient method for live variable analysis for use with data parallel languages is required.